﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using BOHVote.DAL;

namespace BOHVote.BLL
{
    public static class DictManageClass
    {

        /// <summary>
        /// 获取所有激活的字典
        /// </summary>
        /// <returns></returns>
        public static DataSet LoadAdict()
        {
            DictManageProvide dmp = new DictManageProvide();
            DataSet dst = dmp.getAdict("","");
            return dst;
        }

        public static DataSet LoadAdictByID(string dictID)
        {
            DictManageProvide dmp = new DictManageProvide();
            DataSet dst = dmp.getAdict("", dictID);
            return dst;
        }


        /// <summary>
        /// 获取所有字典
        /// </summary>
        /// <returns></returns>
        public static DataSet Loaddict(string ID)
        {
            DictManageProvide dmp = new DictManageProvide();
            DataSet dst = dmp.getDict("",ID);
            return dst;
        }

        public static DataSet LoaddictByValue(string dictValue)
        {
            DictManageProvide dmp = new DictManageProvide();
            DataSet dst = dmp.getDict(dictValue, string.Empty);
            return dst;
        }

        public static DataSet LoadDataDictByName(string DictName)
        {
            DictManageProvide dmp = new DictManageProvide();
            DataSet dst = dmp.getDataDict(DictName,"");
            return dst;
        }

        public static DataSet LoadDataDictByID(string dictID)
        {
            DictManageProvide dmp = new DictManageProvide();
            DataSet dst = dmp.getDataDict("", dictID);
            return dst;
        }

        public static string GetDicNameByValue(string dictName,string dictValue)
        {
            DictManageProvide dmp = new DictManageProvide();
            return dmp.getDicByValue(dictName, dictValue);
        }

        public static int InsertDataDict(string status, string dictValue, string dictName, string dictDisplay, string dictNote)
        {
            DictManageProvide dmp = new DictManageProvide();
            return dmp.InsertDataDict( status,  dictValue,  dictName,  dictDisplay,  dictNote);
        }

        public static int UpdateSysDataDict(string status, string dictValue, string dictName, string dictDisplay, string dictNote, string dictID)
        {
            DictManageProvide dmp = new DictManageProvide();
            return dmp.UpdateSysDataDict( status,  dictValue,  dictName,  dictDisplay,  dictNote,  dictID);
        }

        public static int DeleteDict(string strDictID)
        {
            DictManageProvide dmp = new DictManageProvide();
            return dmp.DeleteDict(strDictID);
        }
    }
}
